package com.dslcode.cloud.provider.order.feign.hystrix;

import com.dslcode.cloud.common.dto.goods.GoodsBuyDTO;
import com.dslcode.cloud.common.dto.goods.GoodsCommonDetailDTO;
import com.dslcode.cloud.common.model.goods.GoodsCommon;
import com.dslcode.cloud.common.utils.AjaxResponse;
import com.dslcode.cloud.provider.order.feign.GoodsProviderFeign;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Set;

/**
 * Created by dongsilin on 2017/9/28.
 */
@Component
public class GoodsProviderHystrix implements GoodsProviderFeign {

    @Override
    public AjaxResponse<GoodsBuyDTO> checkStorage(@PathVariable(name = "id") Long id, @RequestParam(name = "buyNum", defaultValue = "1") int buyNum) throws Exception {
        return AjaxResponse.buildFailed();
    }

    @Override
    public AjaxResponse reduceStorage(@RequestBody Set<GoodsBuyDTO> goodsBuyDTOs) {
        return AjaxResponse.buildFailed();
    }

    @Override
    public AjaxResponse<PageInfo<GoodsCommon>> list(@RequestParam(name = "pageNum", defaultValue = "1") int pageNum, @RequestParam(name = "pageSize", defaultValue = "10") int pageSize) {
        return AjaxResponse.buildFailed();
    }

    @Override
    public AjaxResponse<GoodsCommon> one(@PathVariable(name = "id") Long id) {
        return AjaxResponse.buildFailed();
    }

    @Override
    public AjaxResponse<GoodsCommonDetailDTO> detail(@PathVariable(name = "id") Long id) {
        return AjaxResponse.buildFailed();
    }
}
